//let arr = new Array(2);
//console.log(arr.length);
let arr = Array.of(2);
console.log(arr); // [2] 

// fill() 给数组填充元素
let arr = new Array(2);
arr.fill(5);
console.log(arr);

// find() findIndex
let arr2 = [1,3,5,7,9,7];
// find 找到元素满足条件则返回该元素 否则返回undefined
let res = arr2.findIndex(function(item,index) {
    return item==7;
});
console.log(res);

// copyWithin
// es7 includes 
let arr3 = [1,3,5,7,9,7];
console.log(arr3.includes(9)); //

// for of 
for(let num of arr3) {
    console.log(num); // 值
}
               // ["a","b"]
for (let k of Object.keys({a:1,b:2})) {
    console.log(k);
}